<%--
  - Author		:	Jaewon Choi
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});
		</script>
	</head>
	<body>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="menuTitle">
					콘텐츠 상세보기
				</div>
				<form id="frm" name="frm" method="post" action="<c:url value="/content/form.do" />">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="startDate" value="${param.startDate}" /> 
					<input type="hidden" name="endDate" value="${param.endDate}" />
					<input type="hidden" name="searchName" value="${param.searchName}" />
					<input type="hidden" name="searchCategoryId" value="${param.searchCategoryId}" />
					
					<table class="frmTbl" border="0">
						<colgroup>
							<col width="176px;" />
							<col width="280px" />
							<col width="*" />
							<col width="*" />
						</colgroup>
						<tbody>							
			 				<tr>
								<th>콘텐츠 IDX</th>
								<td colspan="3">
									${content.idx}
									<input type="hidden" name="idx" value="${content.idx}">
								</td>
							</tr>
							<tr>
								<th>카테고리 *</th>
								<td colspan="3">
									<c:forEach items="${categoryList}" var="category" varStatus="cateStat">									
											<label>							
												<c:if test="${(not empty content.idx && category.idx eq content.categoryIdx)}">${category.name}</c:if>												
											</label>
									</c:forEach>
								</td>
							</tr>
							<tr>
								<th>제목</th>
								<td>
									${content.title}
								</td>
								<th>사건 일자</th>
								<td>
									${content.happenDate}								
								</td>
							</tr>
							<tr>
								<th>사건 시간대</th>
								<td colspan="3">
									<c:if test="${content.happenTime eq '1'}">1:00~1:59</c:if>
									<c:if test="${content.happenTime eq '2'}">2:00~2:59</c:if>
									<c:if test="${content.happenTime eq '3'}">3:00~3:59</c:if>
									<c:if test="${content.happenTime eq '4'}">4:00~4:59</c:if>
									<c:if test="${content.happenTime eq '5'}">5:00~5:59</c:if>
									<c:if test="${content.happenTime eq '6'}">6:00~6:59</c:if>
									<c:if test="${content.happenTime eq '7'}">7:00~7:59</c:if>
									<c:if test="${content.happenTime eq '8'}">8:00~8:59</c:if>
									<c:if test="${content.happenTime eq '9'}">9:00~9:59</c:if>
									<c:if test="${content.happenTime eq '10'}">10:00~10:59</c:if>
									<c:if test="${content.happenTime eq '11'}">11:00~11:59</c:if>
									<c:if test="${content.happenTime eq '12'}">12:00~12:59</c:if>
									<c:if test="${content.happenTime eq '13'}">13:00~13:59</c:if>
									<c:if test="${content.happenTime eq '14'}">14:00~14:59</c:if>
									<c:if test="${content.happenTime eq '15'}">15:00~15:59</c:if>
									<c:if test="${content.happenTime eq '16'}">16:00~16:59</c:if>
									<c:if test="${content.happenTime eq '17'}">17:00~17:59</c:if>
									<c:if test="${content.happenTime eq '18'}">18:00~18:59</c:if>
									<c:if test="${content.happenTime eq '19'}">19:00~19:59</c:if>
									<c:if test="${content.happenTime eq '20'}">20:00~20:59</c:if>
									<c:if test="${content.happenTime eq '21'}">21:00~21:59</c:if>
									<c:if test="${content.happenTime eq '22'}">22:00~22:59</c:if>
									<c:if test="${content.happenTime eq '23'}">23:00~23:59</c:if>
									<c:if test="${content.happenTime eq '24'}">00:00~00:59</c:if>
								</td>								
							</tr>
							<tr>
								<th>위도</th>
								<td>
									${content.latitude}
								</td>
								<th>경도</th>
								<td>
									${content.longitude}							
								</td>
							</tr>
							<tr>
								<th>설명</th>
								<td colspan="3">
									<textarea name="contDesc" style="border: none; height: 150px; width: 620px;" onfocus="javascript:this.blur();">${content.contDesc}</textarea>
								</td>
							</tr>		
							<tr>
								<th>현상금 *</th>
								<td >									
									<fmt:formatNumber value="${content.reward}" pattern='#,###' />	
								</td>
								<th>종료여부 *</th>
								<td >
									<c:choose>
										<c:when test="${content.finish eq 0}">진행중</c:when>
										<c:otherwise>종료</c:otherwise>
									</c:choose>
								</td>
							</tr>					
							<tr>
								<th rowspan="${fn:length(mainImgs)+1}">이미지</th>
								<th colspan="3">이미지 파일</th>
							</tr>
							<c:forEach var="mainImg" items="${mainImgs}" varStatus="stat">
								<tr>
									<td colspan="3">
										<img src="${mainImg.fileUrl}" class="thumbnailImg" />
									</td>			
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<input type="button" class="btn" value="목록" onclick="javascript:document.listFrm.submit();" />
					<input type="submit" class="btn" value="수정" />
				</form>
				<form name="listFrm" action="<c:url value="/content/list.do" />" method="post" style="display: none;">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="startDate" value="${param.startDate}" /> 
					<input type="hidden" name="endDate" value="${param.endDate}" />
					<input type="hidden" name="name" value="${param.searchName}" />
					<input type="hidden" name="categoryId" value="${param.searchCategoryId}" />
				</form>
			</div>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
		</div>
	</body>
</html> 